<template>
	<div class="home-container layout-pd" style="min-width:800px;">
		<el-row :gutter="15" class="home-card-one mb15">
			<!-- 个人信息 -->
			<el-col :xs="24" :sm="16">
				<el-card shadow="hover" header="个人信息">
					<div class="personal-user">
						<div class="personal-user-left">
								<img style="width:150px;height:150px" :src="userObj.avatar_url" />
						</div>
						<div class="personal-user-right">
							<el-row>
								<el-col :span="24" class="personal-title mb18">{{ currentTime }}，{{userObj.name}} </el-col>
								<el-col :span="24">
									<el-row>
										<el-col :xs="24" :sm="8" class="personal-item mb6">
											<div class="personal-item-label">昵称：</div>
											<div class="personal-item-value">{{ userObj.username }}</div>
										</el-col>
										<el-col :xs="24" :sm="16" class="personal-item mb6">
											<div class="personal-item-label">身份：</div>
											<div class="personal-item-value" v-for="item in userObj.roles">{{ item }}</div>
										</el-col>
									</el-row>
								</el-col>
								<el-col :span="24">
									<el-row>
										<el-col :xs="24" :sm="8" class="personal-item mb6">
											<div class="personal-item-label">邮箱地址：</div>
											<div class="personal-item-value">{{ userObj.email }}</div>
										</el-col>
										<el-col :xs="24" :sm="16" class="personal-item mb6">
											<div class="personal-item-label">登录时间：</div>
											<div class="personal-item-value">{{ userObj.updated_at }}</div>
										</el-col>
									</el-row>
								</el-col>
							</el-row>
						</div>
					</div>
				</el-card>
			</el-col>

			<!-- 消息通知 -->
			<el-col :xs="24" :sm="8" class="pl15 personal-info">
				<el-card shadow="hover">
					<template #header>
						<div style="display:flex;justify-content:space-between">
							<span>报文日志</span>
							<span class="personal-info-more" @click="router.push('/make/rsm')">更多</span>
						</div>
					</template>
					<div class="personal-info-box">
						<ul class="personal-info-ul" >
							<li v-for="(v, k) in tableData" :key="k" class="personal-info-li" style="display:flex;align-items:center;color:#999;margin-bottom: 9.5px;">
								<div class="addcaard_sert">
										<el-link type="success" style="font-size:16px">[接收]</el-link>
										&emsp;
										<div>rsu</div>&nbsp;
										<div>{{ v.rsu.monitor_pole.name }}</div>&nbsp;
										<div>{{v.type}}数据</div>&nbsp;
								</div>
								<div class="irght_clard_text">{{ v.times }}</div>
							</li>
						</ul>
					</div>
				</el-card>
			</el-col>
		</el-row>
		<el-row :gutter="15" class="home-card-two mb15" style="height: 500px;">
			<el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16">
				<div class="home-card-item" style="height: 100%;">
					<!-- <div style="height: 100%" ref="homeLineRef"></div> -->
					<Map ref="testmap"></Map>
				</div>
				
			</el-col>
			<!-- 设备数量统计 -->
			<el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8" class="home-media">
				<div class="home-card-item" style="height: 100%;">
					<div style="height: 100%" ref="homePieRef"></div>
				</div>
			</el-col>
		</el-row>
		<el-row :gutter="15" class="home-card-three mb15">
			<el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8">
				<div class="home-card-item">
					<div class="home-card-item-title">快捷导航</div>
					<div class="home-monitor">
						<div class="flex-warp">
							<div class="flex-warp-item" v-for="(v, k) in state.homeThree" :key="k" @click="router.push(v.path)">
								<div class="flex-warp-item-box" :class="`home-animation${k}`">
									<div class="flex-margin">
										<i :class="v.icon" :style="{ color: v.iconColor }"></i>
										<span class="pl5">{{ v.label }}</span>
										<div class="mt10">{{ v.value }}</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</el-col>
			<el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16" class="home-media">
				<div class="home-card-item">
					<div style="height: 100%" ref="homeBarRef"></div>
				</div>
			</el-col>
		</el-row>
		<!-- <el-row :gutter="15" class=" mb15">
			<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
				<div class="home-card-item">
					<Map></Map>
				</div>
			</el-col>
			
		</el-row> -->
	</div>
</template>

<script setup lang="ts" name="home">
import { reactive, onMounted, ref, watch, nextTick, onActivated, markRaw ,computed, defineAsyncComponent, onUnmounted} from 'vue';
import { formatAxis } from '/@/utils/formatTime';
import { useRouter,useRoute } from 'vue-router';
import * as echarts from 'echarts';
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
import {useLoginApi} from "/@/api/login/index"
import {homesApi} from "/@/api/home/index"
import { systemStore } from '/@/stores/system';
import {authorityApi} from "/@/api/system/authority/index"
// 引入假地图
const Map = defineAsyncComponent(() => import('/@/components/map/index.vue'));
const route = useRoute();
const homeApi =  homesApi()
const authApi = authorityApi()
const syStore = systemStore()
const router =  useRouter()
// 定义变量内容
const homeLineRef = ref();
const LoginApi = useLoginApi()
const homePieRef = ref();
const homeBarRef = ref();
const storesTagsViewRoutes = useTagsViewRoutes();
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
const { isTagsViewCurrenFull } = storeToRefs(storesTagsViewRoutes);
const currentTime = computed(() => {
	return formatAxis(new Date());
});
const state = reactive({
	global: {
		homeChartOne: null,
		homeChartTwo: null,
		homeCharThree: null,
		dispose: [null, '', undefined],
	} as any,
	homeOne: [
		{
			num1: '125,12',
			num2: '-12.32',
			num3: '订单统计信息',
			num4: 'fa fa-meetup',
			color1: '#FF6462',
			color2: '--next-color-primary-lighter',
			color3: '--el-color-primary',
		},
		{
			num1: '653,33',
			num2: '+42.32',
			num3: '月度计划信息',
			num4: 'iconfont icon-ditu',
			color1: '#6690F9',
			color2: '--next-color-success-lighter',
			color3: '--el-color-success',
		},
		{
			num1: '125,65',
			num2: '+17.32',
			num3: '年度计划信息',
			num4: 'iconfont icon-zaosheng',
			color1: '#6690F9',
			color2: '--next-color-warning-lighter',
			color3: '--el-color-warning',
		},
		{
			num1: '520,43',
			num2: '-10.01',
			num3: '访问统计信息',
			num4: 'fa fa-github-alt',
			color1: '#FF6462',
			color2: '--next-color-danger-lighter',
			color3: '--el-color-danger',
		},
	],
	homeThree: [
		{
			icon: 'iconfont icon-yangan',
			label: 'RSM数据',
			value: 'RSM Notice',
			iconColor: '#F72B3F',
			path:"/make/rsm"
		},
		{
			icon: 'iconfont icon-wendu',
			label: 'SPAT 数据',
			value: 'SPAT Notice',
			iconColor: '#91BFF8',
			path:"/make/spat"
		},
		{
			icon: 'iconfont icon-shidu',
			label: 'BSM 数据',
			value: 'BSM Notice',
			iconColor: '#88D565',
			path:"/make/bsm"
		},
		{
			icon: 'iconfont icon-shidu',
			label: 'RSI 数据',
			value: 'RSI Notice',
			iconColor: '#88D565',
			path:"/make/rsi"
		},
		{
			icon: 'iconfont icon-xuanzeqi',
			label: '实时离线设备',
			value: 'Real-time Equipment',
			iconColor: '#FBD4A0',
			path:"/track/realtime"
		},
		{
			icon: 'iconfont icon-shuju',
			label: '历史离线设备',
			value: 'History Equipment',
			iconColor: '#FBD4A0',
			path:"/track/history"
		},
		{
			icon: 'iconfont icon-siweidaotu',
			label: 'RTK管理',
			value: 'RTK Manage',
			iconColor: '#FBD4A0',
			path:"/roadside/rtk"
		},
		{
			icon: 'iconfont icon-zaosheng',
			label: 'RSU 管理',
			value: 'RSU Manage',
			iconColor: '#FBD4A0',
			path:"/roadside/rsu"
		},
		{
			icon: 'iconfont icon-crew_feature',
			label: 'MEC 管理',
			value: 'MEC Manage',
			iconColor: '#FBD4A0',
			path:"/roadside/mec"
		},
	],
	myCharts: [] as EmptyArrayType,
	charts: {
		theme: '',
		bgColor: '',
		color: '#303133',
	},
	lineXData:[],
	lineBsmData:[],
	lineRsiData:[],
	lineRsmData:[],
	lineSpatData:[],
	pieData:{},
	barXData:[],
	barMecData:[],
	barRsuData:[]
});
const tableData = ref([])
const userObj = ref({})
// 登录用户信息
const getUserInfo = (async ()=>{{
	let res = await LoginApi.getLoginInfo();
	
	if(res.isSuccess){
		syStore.avatar_url = res.returnData.avatar_url;
		syStore.name = res.returnData.name
		userObj.value = res.returnData
	}
}})
const getEchartsList = (async ()=>{
	let res = await homeApi.getTableListApi();
	if(res.isSuccess){
		
		state.lineXData = res.returnData.rsu_data.date;
		state.lineBsmData = res.returnData.rsu_data.bsm;
		state.lineRsiData = res.returnData.rsu_data.rsi;
		state.lineRsmData = res.returnData.rsu_data.rsm;
		state.lineSpatData = res.returnData.rsu_data.spat;
		state.pieData = res.returnData.device_num;
		state.barXData = res.returnData.status.hours;
		state.barMecData = res.returnData.status.mec;
		state.barRsuData = res.returnData.status.rsu;
		initLineChart();
		initPieChart();
		initBarChart();
	}
})
// 报文日志
const getTableList = (async ()=>{
		let data = {
			page:1,
			limit:5,
			orderby: "created_at:desc",
			include:"user"
		}
		tableData.loading = true
		let res = await homeApi.getMarki(data);
		console.log(res,"保温数据---")
		if(res.isSuccess){
			let arrdata=[]
			if( res.returnData.length<5){
				 arrdata=res.returnData
			}else{
				arrdata=JSON.parse(JSON.stringify(res.returnData)).slice(0,5)
			}
			tableData.value = arrdata
		}
	})
	// 报文添加 定时器
	const setI=ref<any>(0)

onUnmounted(()=>{
	console.log('清除了定时器');
	
})
watch( () => route,(o,j)=>{
	if(o.path=="/home"){
		setI.value=setInterval(function(){
			getTableList()
		},30*1000)
	}else{
		clearInterval(setI.value)
	}

}, { deep: true, immediate: true })
// 折线图
const initLineChart = () => {
	return
	if (!state.global.dispose.some((b: any) => b === state.global.homeChartOne)) state.global.homeChartOne.dispose();
	state.global.homeChartOne = markRaw(echarts.init(homeLineRef.value, state.charts.theme));
	const option = {
		backgroundColor: state.charts.bgColor,
		title: {
			text: '报文数据(近一月上报汇总)',
			x: 'left',
			textStyle: { fontSize: '15', color: state.charts.color },
		},
		grid: { top: 70, right: 20, bottom: 30, left: 30 },
		tooltip: { trigger: 'axis' },
		legend: { data: ['BSM', 'RSI','RSM','SPAT'], right: 0 },
		xAxis: {
			data: state.lineXData,
		},
		yAxis: [
			{
				type: 'value',
				name: '数量',
				splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
			},
		],
		series: [
			{
				name: 'BSM',
				type: 'line',
				symbolSize: 6,
				symbol: 'circle',
				smooth: true,
				data: state.lineBsmData,
				lineStyle: { color: '#fe9a8b' },
				itemStyle: { color: '#fe9a8b', borderColor: '#fe9a8b' },
				areaStyle: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
						{ offset: 0, color: '#fe9a8bb3' },
						{ offset: 1, color: '#fe9a8b03' },
					]),
				},
			},
			{
				name: 'RSI',
				type: 'line',
				symbolSize: 6,
				symbol: 'circle',
				smooth: true,
				data: state.lineRsiData,
				lineStyle: { color: '#9E87FF' },
				itemStyle: { color: '#9E87FF', borderColor: '#9E87FF' },
				areaStyle: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
						{ offset: 0, color: '#9E87FFb3' },
						{ offset: 1, color: '#9E87FF03' },
					]),
				},
				emphasis: {
					itemStyle: {
						color: {
							type: 'radial',
							x: 0.5,
							y: 0.5,
							r: 0.5,
							colorStops: [
								{ offset: 0, color: '#9E87FF' },
								{ offset: 0.4, color: '#9E87FF' },
								{ offset: 0.5, color: '#fff' },
								{ offset: 0.7, color: '#fff' },
								{ offset: 0.8, color: '#fff' },
								{ offset: 1, color: '#fff' },
							],
						},
						borderColor: '#9E87FF',
						borderWidth: 2,
					},
				},
			},
			{
				name: 'RSM',
				type: 'line',
				symbolSize: 6,
				symbol: 'circle',
				smooth: true,
				data: state.lineRsmData,
				lineStyle: { color: '#fe9a8b' },
				itemStyle: { color: '#fe9a8b', borderColor: '#fe9a8b' },
				areaStyle: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
						{ offset: 0, color: '#fe9a8bb3' },
						{ offset: 1, color: '#fe9a8b03' },
					]),
				},
			},
			{
				name: 'SPAT',
				type: 'line',
				symbolSize: 6,
				symbol: 'circle',
				smooth: true,
				data: state.lineSpatData,
				lineStyle: { color: '#fe9a8b' },
				itemStyle: { color: '#fe9a8b', borderColor: '#fe9a8b' },
				areaStyle: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
						{ offset: 0, color: '#fe9a8bb3' },
						{ offset: 1, color: '#fe9a8b03' },
					]),
				},
			},
		],
	};
	state.global.homeChartOne.setOption(option);
	state.myCharts.push(state.global.homeChartOne);
};
// 饼图 设备数量统计
const initPieChart = () => {
	if (!state.global.dispose.some((b: any) => b === state.global.homeChartTwo)) state.global.homeChartTwo.dispose();
	state.global.homeChartTwo = markRaw(echarts.init(homePieRef.value, state.charts.theme));
	var getname = ['MEC', 'RSU', '近景相机', '远景相机', '鱼眼相机','信号灯','信号灯采集器','广域毫米波雷达','激光雷达','RTK'];
	// var getvalue = [34.2, 38.87, 17.88, 9.05, 2.05];
	var getvalue=<any>[]
	let keyArray=["mec","rsu","camera_1","camera_2","camera_3","lamp","lampCollector","radar_1","radar_2","rtk"]
	
	keyArray.map((item)=>{
	
		getvalue.push(state.pieData[item])
	})
	
	// for(let key in state.pieData){
	// 	getvalue.push(state.pieData[key])
	// }
	var data = [];
	for (var i = 0; i < getname.length; i++) {
		data.push({ name: getname[i], value: getvalue[i] });
	}
	const colorList = ['#51A3FC', '#36C78B', '#FEC279', '#968AF5', '#E790E8',"#B790E8","#9D5FA7","#6790C9","#47AE85","#FF7300"];
	const option = {
		backgroundColor: state.charts.bgColor,
		title: {
			text: '设备数量统计',
			x: 'left',
			textStyle: { fontSize: '15', color: state.charts.color },
		},
		// tooltip: { trigger: 'item', formatter: '{b} <br/> {c}%' },
		tooltip: { trigger: 'item', formatter: '{b} <br/> {c}' },
		graphic: {
			elements: [
				{
					type: 'image',
					z: -1,
					style: {
						image: themeConfig.value.isIsDark
							? ''
							: '',
						width: 230,
						height: 230,
					},
					left: '14.5%',
					top: 'center',
				},
			],
		},
		legend: {
			type: 'scroll',
			orient: 'vertical',
			right: '0%',
			left: '65%',
			top: 'center',
			itemWidth: 14,
			itemHeight: 14,
			data: getname,
			textStyle: {
				rich: {
					name: {
						fontSize: 14,
						fontWeight: 400,
						width: 200,
						height: 35,
						padding: [0, 0, 0, 60],
						color: state.charts.color,
					},
					rate: {
						fontSize: 15,
						fontWeight: 500,
						height: 35,
						width: 40,
						padding: [0, 0, 0, 30],
						color: state.charts.color,
					},
				},
			},
		},
		series: [
			{
				
				type: 'pie',
				radius: ['82', themeConfig.value.isIsDark ? '50' : '102'],
				center: ['32%', '50%'],
				itemStyle: {
					color: function (params: any) {
						return colorList[params.dataIndex];
					},
				},
				label: { show: false,

					normal:{
						show: false, // 显示数量
						position: 'inside',
						 formatter: '{b}: {c}'
					}
				 },
				 emphasis:{
					label: {
						show: false,
						fontSize: '30',
						fontWeight: 'bold'
					}
				 },
				labelLine: { show: false },
				data: data,
			},
		],
	};
	state.global.homeChartTwo.setOption(option);
	state.myCharts.push(state.global.homeChartTwo);
};
// 柱状图
const initBarChart = () => {
	if (!state.global.dispose.some((b: any) => b === state.global.homeCharThree)) state.global.homeCharThree.dispose();
	state.global.homeCharThree = markRaw(echarts.init(homeBarRef.value, state.charts.theme));
	const option = {
		backgroundColor: state.charts.bgColor,
		title: {
			text: '设备状态上报情况(当天)',
			x: 'left',
			textStyle: { fontSize: '15', color: state.charts.color },
		},
		tooltip: { trigger: 'axis' },
		legend: { data: ['MEC', 'RSU'], right: 0 },
		grid: { top: 70, right: 80, bottom: 30, left: 80 },
		xAxis: [
			{
				type: 'category',
				data: state.barXData,
				boundaryGap: true,
				axisTick: { show: false },
			},
		],
		yAxis: [
			{
				name: 'MEC',
				nameLocation: 'middle',
				nameTextStyle: { padding: [3, 4, 50, 6] },
				splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
				axisLine: { show: false },
				axisTick: { show: false },
				axisLabel: { color: state.charts.color, formatter: '{value} ' },
			},
			{
				name: 'RSU',
				nameLocation: 'middle',
				nameTextStyle: { padding: [50, 4, 5, 6] },
				splitLine: { show: false },
				axisLine: { show: false },
				axisTick: { show: false },
				axisLabel: { color: state.charts.color, formatter: '{value} ' },
			},
		],
		series: [
			
			{
				name: 'RSU',
				type: 'bar',
				barWidth: 30,
				yAxisIndex: 1,
				itemStyle: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
						{ offset: 0, color: 'rgba(108,80,243,0.3)' },
						{ offset: 1, color: 'rgba(108,80,243,0)' },
					]),
					//柱状图圆角
					borderRadius: [30, 30, 0, 0],
				},
				data: state.barRsuData
			},
			{
				name: 'MEC',
				type: 'bar',
				barWidth: 30,
				yAxisIndex: 1,
				itemStyle: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
						{ offset: 0, color: 'rgba(199, 237, 250,0.5)' },
						{ offset: 1, color: 'rgba(199, 237, 250,0.2)' },
					]),
					//柱状图圆角
					borderRadius: [30, 30, 0, 0],
				},
				data:state.barMecData
			},
		],
	};
	state.global.homeCharThree.setOption(option);
	state.myCharts.push(state.global.homeCharThree);
};
// 批量设置 echarts resize
const initEchartsResizeFun = () => {
	nextTick(() => {
		for (let i = 0; i < state.myCharts.length; i++) {
			setTimeout(() => {
				state.myCharts[i].resize();
			}, i * 1000);
		}
	});
};
// 批量设置 echarts resize
const initEchartsResize = () => {
	window.addEventListener('resize', initEchartsResizeFun);
};
const testmap=ref(null)

// 页面加载时
onMounted(() => {
	// initLineChart()
	// initPieChart()
	initEchartsResize();
	getUserInfo()
	getTableList()
	getEchartsList()
});
// 由于页面缓存原因，keep-alive
onActivated(() => {
	initEchartsResizeFun();
});
// 监听 pinia 中的 tagsview 开启全屏变化，重新 resize 图表，防止不出现/大小不变等
watch(
	() => isTagsViewCurrenFull.value,
	() => {
		initEchartsResizeFun();
	}
);
// 监听 pinia 中是否开启深色主题
watch(
	() => themeConfig.value.isIsDark,
	(isIsDark) => {
		
		nextTick(() => {
			
			state.charts.theme = isIsDark ? 'dark' : '';
			state.charts.bgColor = isIsDark ? 'transparent' : '';
			state.charts.color = isIsDark ? '#dadada' : '#303133';
			setTimeout(() => {
				initLineChart();
			}, 500);
			setTimeout(() => {
				initPieChart();
			}, 700);
			setTimeout(() => {
				initBarChart();
			}, 1000);
		});
	},
	{
		deep: true,
		immediate: true,
	}
);
</script>

<style scoped lang="scss">
$homeNavLengh: 8;
.personal-user{
	display: flex;
}
.personal-user-right{
	margin-left: 20px;
	display:flex;
	justify-content: space-around;
}
.personal-title{
	font-size: 18px;
	padding-top:20px
}
.personal-item{
	display: flex;
	align-items: center;
}
.personal-info-ul{
	list-style: none;
}
.personal-info-ul>li{
	font-size: 16px;
	margin-bottom: 11.5px;
	display: flex;
}
.personal-info-more{
	cursor: pointer;
}
.home-container {
	overflow: hidden;
	.home-card-one,
	.home-card-two,
	.home-card-three {
		.home-card-item {
			width: 100%;
			height: 130px;
			border-radius: 4px;
			transition: all ease 0.3s;
			padding: 20px;
			overflow: hidden;
			background: var(--el-color-white);
			color: var(--el-text-color-primary);
			border: 1px solid var(--next-border-color-light);
			&:hover {
				box-shadow: 0 2px 12px var(--next-color-dark-hover);
				transition: all ease 0.3s;
			}
			&-icon {
				width: 70px;
				height: 70px;
				border-radius: 100%;
				flex-shrink: 1;
				i {
					color: var(--el-text-color-placeholder);
				}
			}
			&-title {
				font-size: 15px;
				font-weight: bold;
				height: 30px;
			}
		}
	}
	.home-card-one {
		@for $i from 0 through 3 {
			.home-one-animation#{$i} {
				opacity: 0;
				animation-name: error-num;
				animation-duration: 0.5s;
				animation-fill-mode: forwards;
				animation-delay: calc($i/4) + s;
			}
		}
	}
	.home-card-two,
	.home-card-three {
		.home-card-item {
			height: 400px;
			width: 100%;
			overflow: hidden;
			.home-monitor {
				height: 100%;
				.flex-warp-item {
					width: 25%;
					height: 111px;
					display: flex;
					.flex-warp-item-box {
						margin: auto;
						text-align: center;
						color: var(--el-text-color-primary);
						display: flex;
						border-radius: 5px;
						background: var(--next-bg-color);
						cursor: pointer;
						transition: all 0.3s ease;
						&:hover {
							background: var(--el-color-primary-light-9);
							transition: all 0.3s ease;
						}
					}
					@for $i from 0 through $homeNavLengh {
						.home-animation#{$i} {
							opacity: 0;
							animation-name: error-num;
							animation-duration: 0.5s;
							animation-fill-mode: forwards;
							animation-delay: calc($i/10) + s;
						}
					}
				}
			}
		}
	}
}
.addcaard_sert{
	display: flex;
	align-items: center;
	min-width: 300px;
	white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.irght_clard_text{
	flex: 1;
	white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
